<?php
namespace Home\Controller;

class OfficeController extends HomeController {
	function index() {
		if (!isset($_GET['name'])) {
			$this->meta_title = '处室导航';
			$this->display('index');
		}else {
			$category = D('Category')->info(I('get.name'));
			if($category && 1 == $category['status']){
				switch ($category['display']) {
					case 0 :
						$this->display('您无权查看此分类内容');
						break;
				}
			}else {
				//如果分类不存在，跳转到处室导航页面
				$this->redirect('/Office');
			}
			//判断要显示的模板文件
			$this->meta_title = $category['title'];
			$tpl = empty($category['template_index'])?'common':$category['template_index'];
			$this->display($tpl);
		}
	}
	function lists() {
		
	}
	function detail() {
		
	}
}